import openpyxl

from config.config import SHEET_NAME, FILE_PATH


def read_excel(file_path=FILE_PATH,sheet_name=SHEET_NAME):

    workbook = openpyxl.load_workbook(file_path)
    sheet = workbook[sheet_name]
    data = []

    keys = [cell.value for cell in sheet[2]]
    for row in sheet.iter_rows(min_row=3,values_only=True):
        dict_data = dict(zip(keys,row))
        if dict_data["is_true"]:
            data.append(dict_data)

    print(data)
    workbook.close()

    return data
